﻿$(function () {
    var play = function () {
        var ul = $('#ctenotice');
        ul.children('li').eq(0).animate(
                { 'marginTop': '-25px' }, 1000, '',
                function () {
                    $(this).appendTo(ul);
                    $(this).css('marginTop', 0);
                });
    }
    var robot;
    var autoplay = function () {
        robot = window.setInterval(play, 5000);
    }
    autoplay();
    $('#ctenotice').children('li').each(function () {
        $(this).hover(function () {
            if (robot != null) {
                window.clearInterval(robot);
            }
        }, function () {
            autoplay();
        });
    });
});